Harmony or Divergence Single CandleThis script is designed for traders who seek to visually identify and analyze patterns of harmony and divergence in the price action of securities directly on their trading charts. The script provides a nuanced approach to understanding market sentiment and potential price movement directions by examining candle sizes and volumes over a specified lookback period.
What the Script Does:
The script overlays indicators on the price chart that highlight periods of harmony and divergence using background colors. These periods are determined based on comparisons between current candle sizes, candle volumes, and their respective simple moving averages (SMAs) over a user-defined lookback period.
Harmony : A state where the candle size and volume are either both above or below their respective averages, indicating a consensus or agreement in market direction.
Divergence : A state where there's a mismatch, such as a larger candle size with lower volume or vice versa, suggesting uncertainty or potential reversal in market trends.
How It Does It:
User Inputs : Traders can customize several parameters, including the lookback period for averages, whether to include wicks in candle size calculations, and preferences for displaying harmony and divergence indicators with specific colors.
Calculations :
- The script calculates the simple moving average (SMA) of volume and candle sizes (with an option to consider the full candle range including wicks or just the body) over the specified lookback period.
- It then compares the current candle's size and volume against these averages to identify states of harmony or divergence.
Visualization :
- Based on the user's input, it colors the background of the chart to reflect identified patterns. Each state (harmony above or below average, divergence with higher volume or larger candle body) can be highlighted with different colors, providing immediate visual cues to the trader.
What Traders Can Do With the Script:
Traders can utilize this script to enhance their technical analysis by:
Identifying Trend Consistency : Harmony indicators can signal strong trends where price action and volume confirm each other, possibly supporting continuation strategies.
Spotting Potential Reversals : Divergence indicators may highlight potential exhaustion points or reversals, especially when price moves significantly without corresponding volume support.
Customizing Analysis : By adjusting the lookback period, candle size consideration (body or including wicks), and visualization options, traders can tailor the analysis to fit their trading style and strategy.
스크립트에서 "THE SCRIPT"에 대해 찾기
IU Support and Resistance How this script works :
1. This script is an indicator script which calculates the support and resistance based on pivot high and pivot low and plot them as zone onto the chart.
2. The first user input is minimum number of touches which indicates how many time pivot high or pivot low should be tested in order to be a valid support or resistance level.
3.The second user input "Set Buffer" check if the user wants to use a custom buffer or not if it's unchanged then the default is 50% of the 1000 period ATR value .
4. If "Set Buffer" is checked meaning if it's set to true then only the third user input will be execute which is the "buffer" which indicates how much price range user wants his zone to have.
5. After the user input part this script create two arrays to store the pivot high and pivot low values every time he have a new value.
6. This script also creates two arrays to store the bar index of the bar where the new pivot high or pivot low is detected those bar index will be later use while creating the support and resistance zones.
7. Then the script creates four more arrays to store the final support and resistance values and their respective bar index which will be use for creating the support and resistance zones.
8. After this the script check that we are at the last bar of our chart if we are then we sort the support and resistance indices by descending order and store them into an new variable after that we sort the support and resistance arrays by descending order, then we loop through the arrays elements and we check if the previous element comes under the zone of the current element if so we increase the "minimum touch" variable by 1, once we have 5 or more count in our variable and we no longer have a valid zone then we store the element value and the sorted index of the element into our final arrays.
9. Finally the script will loop through the final support and resistance arrays and it will create a box for each support and resistance with respect to extending it on both directions.
10.The green zones are the support and the red zones are the resistance.
How user can benifits from this script:
1. User can automatically identify support and resistance zones and he can plan his trade as per that.
2. User can test how different markets reacts with support and resistance zones.
3. User can plan breakout trade on the break of the support or resistance level.
4. User can adjust he stop loss and take profit as per the support and resistance zones.
Linear Reg CandlesThe provided Pine Script is a TradingView script for creating a technical analysis indicator called "Humble LinReg Candles." This script includes features such as linear regression for open, high, low, and close prices, signal smoothing with simple or exponential moving averages, and a trailing stop based on Average True Range (ATR). Additionally, the script contains a screener section to display signals for a list of specified symbols.
Here is a breakdown of the script:
Indicator Settings:
It defines various input parameters such as signal smoothing length, linear regression settings, and options for using simple moving averages.
Linear regression is applied to open, high, low, and close prices based on user-defined settings.
ATR Trailing Stop:
It calculates the Average True Range (ATR) and uses it to determine a trailing stop for buy and sell signals.
Signals are generated based on whether the close price is above or below the ATR trailing stop.
Plotting:
The script plots the calculated signal on the chart using the plot function.
Buy and Sell Conditions:
Buy and sell conditions are defined based on the relationship between the close price and the ATR trailing stop.
Plot shapes and bar colors are used to visually represent buy and sell signals on the chart.
Alerts:
Alerts are triggered when buy or sell conditions are met.
Screener Section:
The script defines a screener section to display a watchlist of symbols with long and short signals.
The watchlist includes a set of predefined symbols with corresponding long and short signals.
Table Theme Settings:
The script allows customization of the table theme, including background color, frame color, and text color.
The size and location of the table on the chart can also be customized.
Screener Function:
A function getSignal is defined to determine long and short signals for each symbol in the watchlist.
The getSym function is used to extract the symbol name from the symbol string.
Dashboard Creation:
The script creates a table (dashboard) to display long and short signals for the symbols in the watchlist.
The table includes headers for "Long Signal" and "Short Signal" and lists the symbols with corresponding signals.
Overall, the script combines technical analysis indicators and a screener to help traders identify potential buy and sell signals for a set of specified symbols.
Kiss Of DeathThis Pine Script code is designed to create a technical indicator on a TradingView chart known as the "Kiss of Death" signal. Here's a description of the script:
The script begins by specifying that it is intended for use with Pine Script version 5 (//@version=5) and sets the indicator's title to "Kiss of Death Signal" with indicator(title="Kiss of Death Signal", overlay=true).
The code calculates a 21-period Exponential Moving Average (EMA) of the closing prices (ema21 = ta.ema(close, 21)). The EMA is a commonly used trend-following indicator.
It also determines the lowest low of the previous two periods (prev_low = ta.lowest(low, 2)). This variable will be used in the signal condition.
The script then defines the signal condition for the "Kiss of Death" pattern. This pattern occurs when:
The current closing price is below the 21-period EMA (close < ema21).
The previous closing price is above or equal to the 21-period EMA (close >= ema21).
The current low is below the lowest low of the previous two periods (low < prev_low).
Next, it uses plot to display the 21-period EMA on the chart (plot(ema21, color=color.blue, title="21 EMA")), using a blue color.
Finally, the script utilizes plotshape to mark the points on the chart where the "Kiss of Death" signal condition is met. It places a red, downward-pointing triangle above the corresponding bars
In summary, this script provides a visual representation of the "Kiss of Death" signal on a TradingView chart, helping traders identify potential bearish reversal points based on the defined conditions. The 21-period EMA is also displayed to provide additional context.
What makes this script unique is that it specifically identifies and visualizes a specific technical pattern known as the "Kiss of Death". The "Kiss of Death" is a bearish reversal pattern that occurs when the current price falls below a specific moving average (in this case, a 21-period Exponential Moving Average or EMA) after previously being above it, and when the current low is below the lowest low of the previous two periods.
This script stands out because it provides a clear and visual representation of this particular pattern on a TradingView chart. By using a red, downward-pointing triangle above the bars, it helps traders quickly identify potential bearish reversal points based on the defined conditions.
The combination of a specific pattern, in this case the "Kiss of Death", along with a visual indicator, sets this script apart and makes it a useful tool for traders looking to identify potential bearish reversal points in their technical analysis.
IU Average move How The Script Works :
1. This script calculate the average movement of the price in a user defined custom session and plot the data in a table from on top left corner of the chart.
2. The script takes highest and lowest value of that custom session and store their difference into an array.
3. Then the script average the array thus gets the average price.
4. Addition to that the script converter the price pip change into percentage in order to calculate the value in percentage form.
5. This script is pure price action based the script only take price value and doesn't take any indicator for calculation.
6. The script works on every type of market.
7. If the session is invalid it returns nothing
8. The background color, text color and transparency is changeable.
How User Can Benefit From This Script:
1. User can understand the volatility of any session that he/she wish to trade.
2. It can be helpful for understanding the average price moment of any tradeble asset.
3. It will give the average price movement both in percentage and points bases.
4. By understanding the volatility user can adjust his stop loss or take profit with respect his risk management.
Multi-indicator Signal Builder [Skyrexio]Overview
Multi-Indicator Signal Builder is a versatile, all-in-one script designed to streamline your trading workflow by combining multiple popular technical indicators under a single roof. It features a single-entry, single-exit logic, intrabar stop-loss/take-profit handling, an optional time filter, a visually accessible condition table, and a built-in statistics label. Traders can choose any combination of 12+ indicators (RSI, Ultimate Oscillator, Bollinger %B, Moving Averages, ADX, Stochastic, MACD, PSAR, MFI, CCI, Heikin Ashi, and a “TV Screener” placeholder) to form entry or exit conditions. This script aims to simplify strategy creation and analysis, making it a powerful toolkit for technical traders.
Indicators Overview
1. RSI (Relative Strength Index)
Measures recent price changes to evaluate overbought or oversold conditions on a 0–100 scale.
2. Ultimate Oscillator (UO)
Uses weighted averages of three different timeframes, aiming to confirm price momentum while avoiding false divergences.
3. Bollinger %B
Expresses price relative to Bollinger Bands, indicating whether price is near the upper band (overbought) or lower band (oversold).
4. Moving Average (MA)
Smooths price data over a specified period. The script supports both SMA and EMA to help identify trend direction and potential crossovers.
5. ADX (Average Directional Index)
Gauges the strength of a trend (0–100). Higher ADX signals stronger momentum, while lower ADX indicates a weaker trend.
6. Stochastic
Compares a closing price to a price range over a given period to identify momentum shifts and potential reversals.
7. MACD (Moving Average Convergence/Divergence)
Tracks the difference between two EMAs plus a signal line, commonly used to spot momentum flips through crossovers.
8. PSAR (Parabolic SAR)
Plots a trailing stop-and-reverse dot that moves with the trend. Often used to signal potential reversals when price crosses PSAR.
9. MFI (Money Flow Index)
Similar to RSI but incorporates volume data. A reading above 80 can suggest overbought conditions, while below 20 may indicate oversold.
10. CCI (Commodity Channel Index)
Identifies cyclical trends or overbought/oversold levels by comparing current price to an average price over a set timeframe.
11. Heikin Ashi
A type of candlestick charting that filters out market noise. The script uses a streak-based approach (multiple consecutive bullish or bearish bars) to gauge mini-trends.
12. TV Screener
A placeholder condition designed to integrate external buy/sell logic (like a TradingView “Buy” or “Sell” rating). Users can override or reference external signals if desired.
Unique Features
1. Multi-Indicator Entry and Exit
You can selectively enable any subset of 12+ classic indicators, each with customizable parameters and conditions. A position opens only if all enabled entry conditions are met, and it closes only when all enabled exit conditions are satisfied, helping reduce false triggers.
2. Single-Entry / Single-Exit with Intrabar SL/TP
The script supports a single position at a time. Once a position is open, it monitors intrabar to see if the price hits your stop-loss or take-profit levels before the bar closes, making results more realistic for fast-moving markets.
3. Time Window Filter
Users may specify a start/end date range during which trades are allowed, making it convenient to focus on specific market cycles for backtesting or live trading.
4. Condition Table and Statistics
A table at the bottom of the chart lists all active entry/exit indicators. Upon each closed trade, an integrated statistics label displays net profit, total trades, win/loss count, average and median PnL, etc.
5. Seamless Alerts and Automation
Configure alerts in TradingView using “Any alert() function call.”
The script sends JSON alert messages you can route to your own webhook.
The indicator can be integrated with Skyrexio alert bots to automate execution on major cryptocurrency exchanges
6. Optional MA/PSAR Plots
For added visual clarity, optionally plot the chosen moving averages or PSAR on the chart to confirm signals without stacking multiple indicators.
Methodology
1. Multi-Indicator Entry Logic
When multiple entry indicators are enabled (e.g., RSI + Stochastic + MACD), the script requires all signals to align before generating an entry. Each indicator can be set for crossovers, crossunders, thresholds (above/below), etc. This “AND” logic aims to filter out low-confidence triggers.
2. Single-Entry Intrabar SL/TP
One Position At a Time: Once an entry signal triggers, a trade opens at the bar’s close.
Intrabar Checks: Stop-loss and take-profit levels (if enabled) are monitored on every tick. If either is reached, the position closes immediately, without waiting for the bar to end.
3. Exit Logic
All Conditions Must Agree: If the trade is still open (SL/TP not triggered), then all enabled exit indicators must confirm a closure before the script exits on the bar’s close.
4. Time Filter
Optional Trading Window: You can activate a date/time range to constrain entries and exits strictly to that interval.
Justification of Methodology
Indicator Confluence: Combining multiple tools (RSI, MACD, etc.) can reduce noise and false signals.
Intrabar SL/TP: Capturing real-time spikes or dips provides a more precise reflection of typical live trading scenarios.
Single-Entry Model: Straightforward for both manual and automated tracking (especially important in bridging to bots).
Custom Date Range: Helps refine backtesting for specific market conditions or to avoid known irregular data periods.
How to Use
1. Add the Script to Your Chart
In TradingView, open Indicators , search for “Multi-indicator Signal Builder”.
Click to add it to your chart.
2. Configure Inputs
Time Filter: Set a start and end date for trades.
Alerts Messages: Input any JSON or text payload needed by your external service or bot.
Entry Conditions: Enable and configure any indicators (e.g., RSI, MACD) for a confluence-based entry.
Close Conditions: Enable exit indicators, along with optional SL (negative %) and TP (positive %) levels.
3. Set Up Alerts
In TradingView, select “Create Alert” → Condition = “Any alert() function call” → choose this script.
Entry Alert: Triggers on the script’s entry signal.
Close Alert: Triggers on the script’s close signal (or if SL/TP is hit).
Skyrexio Alert Bots: You can route these alerts via webhook to Skyrexio alert bots to automate order execution on major crypto exchanges (or any other supported broker).
4. Visual Reference
A condition table at the bottom summarizes active signals.
Statistics Label updates automatically as trades are closed, showing PnL stats and distribution metrics.
Backtesting Guidelines
Symbol/Timeframe: Works on multiple assets and timeframes; always do thorough testing.
Realistic Costs: Adjust commissions and potential slippage to match typical exchange conditions.
Risk Management: If using the built-in stop-loss/take-profit, set percentages that reflect your personal risk tolerance.
Longer Test Horizons: Verify performance across diverse market cycles to gauge reliability.
Example of statistic calculation
Test Period: 2023-01-01 to 2025-12-31
Initial Capital: $1,000
Commission: 0.1%, Slippage ~5 ticks
Trade Count: 468 (varies by strategy conditions)
Win rate: 76% (varies by strategy conditions)
Net Profit: +96.17% (varies by strategy conditions)
Disclaimer
This indicator is provided strictly for informational and educational purposes .
It does not constitute financial or trading advice.
Past performance never guarantees future results.
Always test thoroughly in demo environments before using real capital.
Enjoy exploring the Multi-Indicator Signal Builder! Experiment with different indicator combinations and adjust parameters to align with your trading preferences, whether you trade manually or link your alerts to external automation services. Happy trading and stay safe!
Naresh CE with 13 62 crossThank you to Lauris, for sharing knowledge and logic for the EMA cross-over (13/62).
The provided Pine Script is a custom script, which is designed to display Chandelier Exit levels on the price chart and generate buy and sell labels based on specific conditions.
Here's a breakdown of the key components and logic of the Pine Script:
Exponential Moving Averages (EMAs):
ema1: The 13-period Exponential Moving Average (EMA) of the closing price.
ema2: The 62-period Exponential Moving Average (EMA) of the closing price.
EMA Plotting:
The script plots the ema1 (13 EMA) and ema2 (62 EMA) lines on the price chart using the plot() function.
Chandelier Exit Calculation:
The Chandelier Exit values are calculated using the Average True Range (ATR).
The script calculates the atr (Average True Range) using the atr() function with the given length.
longStop is calculated as the highest price of the specified length minus the ATR, and shortStop is calculated as the lowest price plus the ATR.
Directional Indicator (dir):
The dir variable is used to determine the direction of the Chandelier Exit based on the comparison of the current close price with the previous long and short stops.
Buy and Sell Signals:
The script generates buy signals when the Chandelier Exit direction changes from short to long (buySignal).
Similarly, sell signals are generated when the Chandelier Exit direction changes from long to short (sellSignal).
The conditions for buy and sell signals are based on the value of dir and its previous value.
Buy and Sell Labels:
Buy and sell labels are plotted on the chart using plotshape() based on the generated buy and sell signals.
The showLabels input parameter controls whether to display the buy and sell labels.
Highlighting States:
The script fills the chart area with color (green for long, red for short) based on the direction of the Chandelier Exit values.
The highlightState input parameter controls whether to apply this highlighting.
Alerts:
The script includes alert conditions based on the direction change (changeCond), buy signal (buySignal), and sell signal (sellSignal) using the alertcondition() function.
The script aims to help traders identify potential buy and sell signals based on the Chandelier Exit levels derived from the 13 EMA and 62 EMA crossovers. The Chandelier Exit values can serve as dynamic stop-loss levels for long and short positions.
Oscillator Workbench — Chart [LucF]█ OVERVIEW
This indicator uses an on-chart visual framework to help traders with the interpretation of any oscillator's behavior. The advantage of using this tool is that you do not need to know all the ins and outs of a particular oscillator such as RSI, CCI, Stochastic, etc. Your choice of oscillator and settings in this indicator will change its visuals, which allows you to evaluate different configurations in the context of how the workbench models oscillator behavior. My hope is that by using the workbench, you may come up with an oscillator selection and settings that produce visual cues you find useful in your trading.
The workbench works on any symbol and timeframe. It uses the same presentation engine as my Delta Volume Channels indicator; those already familiar with it will feel right at home here.
█ CONCEPTS
Oscillators
An oscillator is any signal that moves up and down a centerline. The centerline value is often zero or 50. Because the range of oscillator values is different than that of the symbol prices we look at on our charts, it is usually impossible to display an oscillator on the chart, so we typically put oscillators in a separate pane where they live in their own space. Each oscillator has its own profile and properties that dictate its behavior and interpretation. Oscillators can be bounded , meaning their values oscillate between fixed values such as 0 to 100 or +1 to -1, or unbounded when their maximum and minimum values are undefined.
Oscillator weight
How do you display an oscillator's value on a chart showing prices when both values are not on the same scale? The method I use here converts the oscillator's value into a percentage that is used to weigh a reference line. The weight of the oscillator is calculated by maintaining its highest and lowest value above and below its centerline since the beginning of the chart's history. The oscillator's relative position in either of those spaces is then converted to a percentage, yielding a positive or negative value depending on whether the oscillator is above or below its centerline. This method works equally well with bounded and unbounded oscillators.
Oscillator Channel
The oscillator channel is the space between two moving averages: the reference line and a weighted version of that line. The reference line is a moving average of a type, source and length which you select. The weighted line uses the same settings, but it averages the oscillator-weighted price source.
The weight applied to the source of the reference line can also include the relative size of the bar's volume in relation to previous bars. The effect of this is that the oscillator's weight on bars with higher total volume will carry greater weight than those with lesser volume.
The oscillator channel can be in one of four states, each having its corresponding color:
• Bull (teal): The weighted line is above the reference line.
• Strong bull (lime): The bull condition is fulfilled and the bar's close is above the reference line and both the reference and the weighted lines are rising.
• Bear (maroon): The weighted line is below the reference line.
• Strong bear (pink): The bear condition is fulfilled and the bar's close is below the reference line and both the reference and the weighted lines are falling.
Divergences
In the context of this indicator, a divergence is any bar where the slope of the reference line does not match that of the weighted line. No directional bias is assigned to divergences when they occur. You can also choose to define divergences as differences in polarity between the oscillator's slope and the polarity of close-to-close values. This indicator's divergences are designed to identify transition levels. They have no polarity; their bullish/bearish bias is determined by the behavior of price relative to the divergence channel after the divergence channel is built.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's low and high ) saved when divergences occur. When price has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Price breaches of the divergence channel will change its state. Divergence channels can be in one of five different states:
• Bull (teal): Price has breached the channel to the upside.
• Strong bull (lime): The bull condition is fulfilled and the oscillator channel is in the strong bull state.
• Bear (maroon): Price has breached the channel to the downside.
• Strong bear (pink): The bear condition is fulfilled and the oscillator channel is in the strong bear state.
• Neutral (gray): The channel has not been breached.
█ HOW TO USE THE INDICATOR
Load the indicator on an active chart (see here if you don't know how).
The default configuration displays:
• The Divergence channel's levels.
• Bar colors using the state of the oscillator channel.
The default settings use:
• RSI as the oscillator, using the close source and a length of 20 bars.
• An Arnaud-Legoux moving average on the close and a length of 20 bars as the reference line.
• The weighted version of the reference line uses only the oscillator's weight, i.e., without the relative volume's weight.
The weighted line is capped to three standard deviations of the reference.
• The divergence channel's levels are determined using the high and low of the bars where divergences occur.
Breaches of the channel require a bar's low to move above the top of the channel, and the bar's high to move below the channel's bottom.
No markers appear on the chart; if you want to create alerts from this script, you will need first to define the conditions that will trigger the markers, then create the alert, which will trigger on those same conditions.
To learn more about how to use this indicator, you must understand the concepts it uses and the information it displays, which requires reading this description. There are no videos to explain it.
█ FEATURES
The script's inputs are divided in five sections: "Oscillator", "Oscillator channel", "Divergence channel", "Bar Coloring" and "Marker/Alert Conditions".
Oscillator
This is where you configure the oscillator you want to study. Thirty oscillators are available to choose from, but you can also use an oscillator from another indicator that is on your chart, if you want. When you select an external indicator's plot as the oscillator, you must also specify the value of its centerline.
Oscillator Channel
Here, you control the visibility and colors of the reference line, its weighted version, and the oscillator channel between them.
You also specify what type of moving average you want to use as a reference line, its source and its length. This acts as the oscillator channel's baseline. The weighted line is also a moving average of the same type and length as the reference line, except that it will be calculated from the weighted version of the source used in the reference line. By default, the weighted line is capped to three standard deviations of the reference line. You can change that value, and also elect to cap using a multiple of ATR instead. The cap provides a mechanism to control how far the weighted line swings from the reference line. This section is also where you can enable the relative volume component of the weight.
Divergence Channel
This is where you control the appearance of the divergence channel and the key price values used in determining the channel's levels and breaching conditions. These choices have an impact on the behavior of the channel. More generous level prices like the default low and high selection will produce more conservative channels, as will the default choice for breach prices.
In this section, you can also enable a mode where an attempt is made to estimate the channel's bias before price breaches the channel. When it is enabled, successive increases/decreases of the channel's top and bottom levels are counted as new divergences occur. When one count is greater than the other, a bull/bear bias is inferred from it. You can also change the detection mode of divergences, and choose to display a mark above or below bars where divergences occur.
Bar Coloring
You specify here:
• The method used to color chart bars, if you choose to do so.
• If you want to hollow out the bodies of bars where volume has not increased since the last bar.
Marker/Alert Conditions
Here, you specify the conditions that will trigger up or down markers. The trigger conditions can include a combination of state transitions of the oscillator and the divergence channels. The triggering conditions can be filtered using a variety of conditions.
Configuring the marker conditions is necessary before creating an alert from this script, as the alert will use the marker conditions to trigger.
Realtime values will repaint, as is usually the case with oscillators, but markers only appear on bar closes, so they will not repaint. Keep in mind, when looking at markers on historical bars, that they are positioned on the bar when it closes — NOT when it opens.
Raw values
The raw values calculated by this script can be inspected using the Data Window, including the oscillator's value and the weights.
█ INTERPRETATION
Except when mentioned otherwise, this section's charts use the indicator's default settings, with different visual components turned on or off.
The aim of the oscillator channel is to provide a visual representation of an oscillator's general behavior. The simplest characteristic of the channel is its bull/bear state, determined by whether the weighted line is above or below the reference line. One can then distinguish between its bull and strong bull states, as transitions from strong bull to bull states will generally happen when trends are losing steam. While one should not infer a reversal from such transitions, they can be a good place to tighten stops. Only time will tell if a reversal will occur. One or more divergences will often occur before reversals. This shows the oscillator channel, with the reference line and the thicker, weighted line:
The nature of the divergence channel 's design makes it particularly adept at identifying consolidation areas if its settings are kept on the conservative side. The divergence channel will also reveal transition areas. A gray divergence channel should usually be considered a no-trade zone. More adventurous traders can use the oscillator channel to orient their trade entries if they accept the risk of trading in a neutral divergence channel, which by definition will not have been breached by price. This show only the divergence channels:
This chart shows divergence channels and their levels, and colors bars on divergences and on the state of the oscillator channel, which is not visible on the chart:
If your charts are already busy with other stuff you want to hold on to, you could consider using only the chart bar coloring component of this indicator. Here we only color bars using the combined state of the oscillator and divergence channel, and we do not color the bodies of bars where volume has not increased. Note that my chart's settings do not color the candle bodies:
At its simplest, one way to use this indicator would be to look for overlaps of the strong bull/bear colors in both the oscillator channel and a divergence channel, as these identify points where price is breaching the divergence channel when the oscillator's state is consistent with the direction of the breach.
Tip
One way to use the Workbench is to combine it with my Delta Volume Channels indicator. If both indicators use the same MA as a reference line, you can display its delta volume channel instead of the oscillator channel.
This chart shows such a setup. The Workbench displays its divergence levels, the weighted reference line using the default RSI oscillator, and colors bars on divergences. The DV Channels indicator only displays its delta volume channel, which uses the same MA as the workbench for its baseline. This way you can ascertain the volume delta situation in contrast with the visuals of the Workbench:
█ LIMITATIONS
• For some of the oscillators, assumptions are made concerning their different parameters when they are more complex than just a source and length.
See the `oscCalc()` function in this indicator's code for all the details, and ask me in a comment if you can't find the information you need.
• When an oscillator using volume is selected and no volume information is available for the chart's symbol, an error will occur.
• The method I use to convert an oscillator's value into a percentage is fragile in the early history of datasets
because of the nascent expression of the oscillator's range during those early bars.
█ NOTES
Working with this workbench
This indicator is called a workbench for a reason; it is designed for traders interested in exploring its behavior with different oscillators and settings, in the hope they can come up with a setup that suits their trading methodology. I cannot tell you which setup is the best because its setup should be compatible with your trading methodology, which may require faster or slower transitions, thus different configurations of the settings affecting the calculations of the divergence channels.
For Pine Script™ Coders
• This script uses the new overload of the fill() function which now makes it possible to do vertical gradients in Pine. I use it for both channels displayed by this script.
• I use the new arguments for plot() 's `display` parameter to control where the script plots some of its values,
namely those I only want to appear in the script's status line and in the Data Window.
• I used my ta library for some of the oscillator calculations and helper functions.
• I also used TradingView's ta library for other oscillator calculations.
• I wrote my script using the revised recommendations in the Style Guide from the Pine v5 User Manual.
Coin Bureau BB/EMA/RSI IndicatorThis indicator was inspired by Coin Bureau's How To Spot The Crypto Top video. In the video, Coin Bureau uses Bollinger bands, 7-period EMA and RSI to look for early signs of a top, thus presenting an opportunity to sell.
Using the basic principles found in the video, I've made a tentative indicator as a way to visualise all 3 indicators at once. Alerts will only fire when all 3 criteria are met:
Price closes outside 20-period Bollinger bands
Price closes ~2sd away from 7-period EMA
RSI is overbought or oversold
The indicator will also update in real-time and show when 1, 2 or all 3 conditions are satisfied. Additionally, there is built-in functionality to toggle historical/current alerts and users can set their own bounds for what constitutes a buy or sell alert.
This is just a personal project purely for edutainment purposes and should not be used to make financial decisions. This project is not affiliated with Coin Bureau.
Some caveats:
Using only 7 periods to calculate the standard deviation of price data will not lead to a statistically significant result, thus this figure may have no right being in the script. However, this was more to trial some techniques and to get acquainted with the pine scripting language.
As you can see, there are a lot of false positives. There are moments when the indicator flashes a sell alert only for the price to keep on rising. This is due to the specificity/sensitivity trade-off. The indicator has been tuned to give the optimal sensitivity (the more critical component). These are the best results I could find for this asset in this time frame.
3rd WaveHello All,
In Elliott Wave Theory, 3rd wave is not the shortest one in the waves 1/3/5 and it's usually longest one. so if we can catch it then we may get good opportunities to trade. This script finds 3rd wave experimentally. it can be also the 3rd waves in the waves 1, 3, 5, A and C. the 3rd wave should have greater volume than other waves, the script can check its volume and compare with the volumes of the waves 1 and 2 optionally.
Pine Team released Pine version 5! This script was developed in v5 and it uses Library feature of Pine v5 for the zigzag functions. This script is also an example for the Pine developers who learn Pine v5 and Libraries.
Options:
Zigzag Period: is the length that is used to calculate highest/lowest and the zigzag waves
Min/Max Retracements: is the retracement rates to check the wave 2 according to wave 1. for example; if min/max values are 0.500-0.618 then wave 2 must be minimum 0.500 of wave 1 and maximum 0.618 of wave 1.
Check Volume Support: is an option to compare the volumes of1. 2. and . waves. if you enable this option then the script checks their volume and 3rd wave volume must be greater then 1 and 2
there are 4 options for the targets. you can enable/disable and change their levels. targets are calculated using length of wave 1.
Options to show breakout zone, zigzag, wave 1 and 2.
and some options for the colors.
The Library that is used in this script:
P.S. This is an experimental work and can be improved. So do not hesitate to drop your comments under the script ;)
Enjoy!
[SCL] Significant Figures Example FunctionThis script consist of a single example function that takes a floating-point number - one that can, but doesn't have to, include a decimal point - and converts it to a floating-point number with only a certain number of significant digits left.
I'm not aware of another script that does this. There might well be a simpler way, in which case please do let me know.
For example, say you want to display a variable from your script to the user and it comes out to something like 45.366666666666666666666667 or whatever. That looks awful when you, for example, print it in a label.
Now, you could round it up to the nearest integer easily using a built-in function, or even to a certain number of decimal places using a reasonably simple custom function.
But that's a bit arbitrary. Suppose you don't know what asset the script will be used on, and so you can't predict what the price is, and what the value will turn out to be.
It could be 0.00045366666666666666666666667 instead. Now if you round it up to 3 decimal places it comes out as 0.000, which is useless.
My function will round that number to 0.0004536 instead, if told to do it to 4 significant digits.
You're free to use this function in your own scripts, including closed-source scripts, without asking permission. Credit to @SimpleCryptoLife would be appreciated.
TTM Squeeze Scanner This script scans for TTM Squeezes for the crypto symbols included in the body of the script. The timeframe for the squeeze scan is controlled within the input not the chart.
This script is a merge of @Nico.Muselle's TTM Squeeze script and @QuantNomad's custom screener script. Thanks to both of them!
Daily Percent Change LabelDaily Percent Change Label
Overview
This Pine Script displays the percentage change from the previous day's closing price as a text label near the current price level on the chart. It works seamlessly across any timeframe (daily, hourly, minute charts) by referencing the daily chart's previous close, making it perfect for traders tracking daily performance.
The label is displayed with a semi-transparent background (green for positive changes, red for negative changes) and white text, ensuring a clean and readable appearance.
Features
Accurate Daily Percent Change: Calculates the percentage change based on the previous day's closing price, even on intraday timeframes (e.g., 1-hour, 5-minute).
Dynamic Label: Shows the percentage change as a label aligned with the current price, updating in real-time.
Color-Coded Background: Semi-transparent green background for positive changes and red for negative changes.
Customizable: Adjust label position, size, color, and style to fit your preferences.
Minimal Impact: No additional plots or graphs, keeping the chart uncluttered.
How to Use
Add the Script:
Copy and paste the script into the Pine Editor in TradingView.
Click "Add to Chart" to apply it.
Check the Output:
A text label (e.g., "+2.34%" or "-1.56%") appears near the current price with a semi-transparent background.
The label is colored green (positive) or red (negative) and updates in real-time.
Switch Timeframes:
Works on any timeframe. The percentage change is always calculated relative to the previous day's close.
Customization Options
Modify the label.new function to customize the label:
Label Position:
Change style=label.style_label_left to label.style_label_right or label.style_label_down to adjust label placement.
Adjust bar_index with an offset (e.g., bar_index + 1) to move the label horizontally.
Text Color:
Modify textcolor=color.white to another color (e.g., color.rgb(255, 255, 0) for yellow).
Background Color:
Adjust color=percent_change >= 0 ? color.new(color.green, 50) : color.new(color.red, 50) to change transparency (e.g., color.new(color.green, 0) for no transparency).
Text Size:
Change size=size.normal to size.small or size.large for smaller or larger text.
Code Details
Timeframe Handling: Uses request.security with the "D" timeframe to fetch the previous day's closing price, ensuring accuracy on intraday charts.
Performance: Updates only on the last bar (barstate.islast) for optimal performance.
Dynamic Styling: Background color changes based on the direction of the price change.
Notes
The label is positioned near the current price for easy reference. To move it closer to the Y-axis, adjust the bar_index offset.
For different reference points (e.g., weekly close), modify the request.security timeframe (e.g., "W" for weekly).
Ensure the script is copied correctly without extra spaces or characters. Use a plain text editor (e.g., Notepad) for copying.
Feedback
Please share your feedback or customizations in the comments! If you find this script helpful, give it a thumbs-up or let others know how you're using it. Happy trading!
Anchored Darvas Box## ANCHORED DARVAS BOX
---
### OVERVIEW
**Anchored Darvas Box** lets you drop a single timestamp on your chart and build a Darvas-style consolidation zone forward from that exact candle. The indicator freezes the first user-defined number of bars to establish the range, verifies that price respects that range for another user-defined number of bars, then waits for the first decisive breakout. The resulting rectangle captures every tick of the accumulation phase and the exact moment of expansion—no manual drawing, complete timestamp precision.
---
### HISTORICAL BACKGROUND
Nicolas Darvas’s 1950s box theory tracked institutional accumulation by hand-drawing rectangles around tight price ranges. A trade was triggered only when price escaped the rectangle.
The anchored version preserves Darvas’s logic but pins the entire sequence to a user-chosen candle: perfect for analysing a market open, an earnings release, FOMC minute, or any other catalytic bar.
---
### ALGORITHM DETAIL
1. **ANCHOR BAR**
*You provide a timestamp via the settings panel.* The script waits until the chart reaches that bar and records its index as **startBar**.
2. **RANGE DEFINITION — BARS 1-7**
• `rangeHigh` = highest high of bars 1-7 plus optional tolerance.
• `rangeLow` = lowest low of bars 1-7 minus optional tolerance.
3. **RANGE VALIDATION — BARS 8-14**
• Price must stay inside ` `.
• Any violation aborts the test; no box is created.
4. **ARMED STATE**
• If bars 8-14 hold the range, two live guide-lines appear:
– **Green** at `rangeHigh`
– **Red** at `rangeLow`
• The script is now “armed,” waiting indefinitely for the first true breakout.
5. **BREAKOUT & BOX CREATION**
• **Up breakout** =`high > rangeHigh` → rectangle drawn in **green**.
• **Down breakout**=`low < rangeLow` → rectangle drawn in **red**.
• Box extends from **startBar** to the breakout bar and never updates again.
• Optional labels print the dollar and percentage height of the box at its left edge.
6. **OPTIONAL COOLDOWN**
• After the box is painted the script can stay silent for a user-defined number of bars, letting you study the fallout without another range immediately arming on top of it.
---
### INPUT PARAMETERS
• **ANCHOR TIME** – Precise yyyy-mm-dd HH:MM:SS that seeds the sequence.
• **BARS TO DEFINE RANGE** – Default 7; affects both definition and validation windows.
• **OPTIONAL TOLERANCE** – Absolute price buffer to ignore micro-wicks.
• **COOLDOWN BARS AFTER BREAKOUT** – Pause length before the indicator is allowed to re-anchor (set to zero to disable).
• **SHOW BOX DISTANCE LABELS** – Toggle to print Δ\$ and Δ% on every completed box.
---
### USER WORKFLOW
1. Add the indicator, open settings, and set **ANCHOR TIME** to the candle you care about (e.g., “2025-04-23 09:30:00” for NYSE open).
2. Watch live as the script:
– Paints the seven-bar range.
– Draws validation lines.
– Locks in the box on breakout.
3. Use the box boundaries as structural stops, targets, or context for further trades.
---
### PRACTICAL APPLICATIONS
• **OPENING RANGE BREAKOUTS** – Anchor at the first second of the session; capture the initial 7-bar range and trade the first clean break.
• **EVENT STUDIES** – Anchor at a news candle to measure immediate post-event volatility.
• **VOLUME PROFILE FUSION** – Combine the anchored box with VPVR to see if the breakout occurs at a high-volume node or a low-liquidity pocket.
• **RISK DISCIPLINE** – Stop-loss can sit just inside the opposite edge of the anchored range, enforcing objective risk.
---
### ADVANCED CUSTOMISATION IDEAS
• **MULTIPLE ANCHORS** – Clone the indicator and anchor several boxes (e.g., London open, New York open).
• **DYNAMIC WINDOW** – Switch the 7-bar fixed length to a volatility-scaled length (ATR percentile).
• **STRATEGY WRAPPER** – Turn the indicator into a `strategy{}` script and back-test anchored boxes on decades of data.
---
### FINAL THOUGHTS
Anchored Darvas Boxes give you Darvas’s timeless range-break methodology anchored to any candle of interest—perfect for dissecting openings, economic releases, or your own bespoke “important” bars with laboratory precision.
Auto Darvas Boxes## AUTO DARVAS BOXES
---
### OVERVIEW
**Auto Darvas Boxes** is a fully-automated, event-driven implementation of Nicolas Darvas’s 1950s box methodology.
The script tracks consolidation zones in real time, verifies that price truly “respects” those zones for a fixed validation window, then waits for the first decisive range violation to mark a directional breakout.
Every box is plotted end-to-end—from the first candle of the sideways range to the exact candle that ruptures it—giving you an on-chart, visually precise record of accumulation or distribution and the expansion that follows.
---
### HISTORICAL BACKGROUND
* Nicolas Darvas was a professional ballroom dancer who traded U.S. equities by telegram while touring the world.
* Without live news or Level II, he relied exclusively on **price** to infer institutional intent.
* His core insight: true market-moving entities leave footprints in the form of tight ranges; once their buying (or selling) is complete, price erupts out of the “box.”
* Darvas’s original procedure was manual—he kept notebooks, drew rectangles around highs and lows, and entered only when price punched out of the roof of a valid box.
* This indicator distills that logic into a rolling, self-resetting state machine so you never miss a box or breakout on any timeframe.
---
### ALGORITHM DETAIL (FOUR-STATE MACHINE)
**STATE 0 – RANGE DEFINITION**
• Examine the last *N* candles (default 7).
• Record `rangeHigh = highest(high, N) + tolerance`.
• Record `rangeLow = lowest(low, N) – tolerance`.
• Remember the index of the earliest bar in this window (`startBar`).
• Immediately transition to STATE 1.
**STATE 1 – RANGE VALIDATION**
• Observe the next *N* candles (again default 7).
• If **any** candle prints `high > rangeHigh` or `low < rangeLow`, the validation fails and the engine resets to STATE 0 **beginning at the violating candle**—no halfway boxes, no overlap.
• If all *N* candles remain inside the range, the box becomes **armed** and we transition to STATE 2.
**STATE 2 – ARMED (LIVE VISUAL FEEDBACK)**
• Draw a **green horizontal line** at `rangeHigh`.
• Draw a **red horizontal line** at `rangeLow`.
• Lines are extended in real time so the user can see the “live” Darvas ceiling and floor.
• Engine waits indefinitely for a breakout candle:
– **Up-Breakout** if `high > rangeHigh`.
– **Down-Breakout** if `low < rangeLow`.
**STATE 3 – BREAKOUT & COOLDOWN**
• Upon breakout the script:
1. Deletes the live range lines.
2. Draws a **filled rectangle (box)** from `startBar` to the breakout bar.
◦ **Green fill** when price exits above the ceiling.
◦ **Red fill** when price exits below the floor.
3. Optionally prints two labels at the left edge of the box:
◦ Dollar distance = `rangeHigh − rangeLow`.
◦ Percentage distance = `(rangeHigh − rangeLow) / rangeLow × 100 %`.
• After painting, the script waits a **user-defined cooldown** (default = 7 bars) before reverting to STATE 0. The cooldown guarantees separation between consecutive tests and prevents overlapping rectangles.
---
### INPUT PARAMETERS (ALL ADJUSTABLE FROM THE SETTINGS PANEL)
* **BARS TO DEFINE RANGE** – Number of candles used for both the definition and validation windows. Classic Darvas logic uses 7 but feel free to raise it on higher timeframes or volatile instruments.
* **OPTIONAL TOLERANCE** – Absolute price buffer added above the ceiling and below the floor. Use a small tolerance to ignore single-tick spikes or data-feed noise.
* **COOLDOWN BARS AFTER BREAKOUT** – How long the engine pauses before hunting for the next consolidation. Setting this equal to the range length produces non-overlapping, evenly spaced boxes.
* **SHOW BOX DISTANCE LABELS** – Toggle on/off. When on, each completed box displays its vertical size in both dollars and percentage, anchored at the box’s left edge.
---
### REAL-TIME VISUALISATION
* During the **armed** phase you see two extended, colour-coded guide-lines showing the exact high/low that must hold.
* When the breakout finally occurs, those lines vanish and the rectangle instantly appears, coloured to match the breakout direction.
* This immediate visual feedback turns any chart into a live Darvas tape—no manual drawing, no lag.
---
### PRACTICAL USE-CASES & BEST-PRACTICE WORKFLOWS
* **INTRADAY MOMENTUM** – Drop the script on 1- to 15-minute charts to catch tight coils before they explode. The coloured box marks the precise origin of the expansion; stops can sit just inside the opposite side of the box.
* **SWING & POSITION TRADING** – On 4-hour or daily charts, boxes often correspond to accumulation bases or volatility squeezes. Waiting for the box-validated breakout filters many false signals.
* **MEAN-REVERSION OR “FADE” STRATEGIES** – If a breakout immediately fails and price re-enters the box, you may have trapped momentum traders; fading that failure can be lucrative.
* **RISK MANAGEMENT** – Box extremes provide objective, structure-based stop levels rather than arbitrary ATR multiples.
* **BACK-TEST RESEARCH** – Because each box is plotted from first range candle to breakout candle, you can programmatically measure hold time, range height, and post-breakout expectancy for any asset.
---
### CUSTOMISATION IDEAS FOR POWER USERS
* **VOLATILITY-ADAPTIVE WINDOW** – Replace the fixed 7-bar length with a dynamic value tied to ATR percentile so the consolidation window stretches or compresses with volatility.
* **MULTI-TIMEFRAME LOGIC** – Only arm a 5-minute box if the 1-hour trend is aligned.
* **STRATEGY WRAPPER** – Convert the indicator to a full `strategy{}` script, automate entries on breakouts, and benchmark performance across assets.
* **ALERTS** – Create TradingView alerts on both up-breakout and down-breakout conditions; route them to webhook for broker automation.
---
### FINAL THOUGHTS
**Auto Darvas Boxes** packages one of the market’s oldest yet still potent price-action frameworks into a modern, self-resetting indicator. Whether you trade equities, futures, crypto, or forex, the script highlights genuine contraction-expansion sequences—Darvas’s original “boxes”—with zero manual effort, letting you focus solely on execution and risk.
Frozen Bias Zones – Sentiment Lock-insOverview
The Frozen Bias Zones indicator visualizes market sentiment lock-ins using a combination of RSI, MACD, and OBV. It creates "bias zones" that indicate whether the market is in a sustained bullish or bearish phase. These zones are then highlighted on the chart, helping traders spot when the market is locked in a bias. The script also detects breakout events from these zones and marks them with clear labels for easier decision-making.
Features
Multi-Indicator Sentiment Analysis: Combines RSI, MACD, and OBV to detect synchronized bullish or bearish sentiment.
Frozen Bias Zones: Identifies and visually represents zones where the market has remained in a particular sentiment (bullish or bearish) for a defined period.
Breakout Alerts: Displays labels to indicate when the price breaks out of the established bias zone.
Customizable Inputs: Adjust the zone duration, RSI, MACD, and breakout label visibility.
Input Parameters
Bias Duration (biasLength)
The minimum number of candles the market must stay in a specific sentiment to consider it a "Frozen Bias Zone".
Default: 5 candles.
RSI Period (rsiPeriod)
Period for the Relative Strength Index (RSI) calculation.
Default: 14 periods.
MACD Settings
MACD Fast (macdFast): The fast-moving average period for the MACD calculation.
Default: 12.
MACD Slow (macdSlow): The slow-moving average period for the MACD calculation.
Default: 26.
MACD Signal (macdSig): The signal line period for MACD.
Default: 9.
Show Break Label (showBreakLabel)
Toggle to show labels when the price breaks out of the bias zone.
Default: True (shows label).
Bias Zone Colors
Bullish Bias Color (bullColor): The color for bullish zones (light green).
Bearish Bias Color (bearColor): The color for bearish zones (light red).
How It Works
This indicator analyzes three key market metrics to determine whether the market is in a bullish or bearish phase:
RSI (Relative Strength Index)
Measures the speed and change of price movements. RSI > 50 indicates a bullish phase, while RSI < 50 indicates a bearish phase.
MACD (Moving Average Convergence Divergence)
Measures the relationship between two moving averages of the price. A positive MACD histogram indicates bullish momentum, while a negative histogram indicates bearish momentum.
OBV (On-Balance Volume)
Uses volume flow to determine if a trend is likely to continue. A rising OBV indicates bullish accumulation, while a falling OBV indicates bearish distribution.
Bias Zone Detection
The market sentiment is considered bullish if all three indicators (RSI, MACD, and OBV) are bullish, and bearish if all three indicators are bearish.
Bullish Zone: A zone is created when the market sentiment remains bullish for the duration of the specified biasLength.
Bearish Zone: A zone is created when the market sentiment remains bearish for the duration of the specified biasLength.
These bias zones are visually represented on the chart as colored boxes (green for bullish, red for bearish).
Breakout Detection
The script automatically detects when the market exits a bias zone. If the price moves outside the bounds of the established zone (either up or down), the script will display one of the following labels:
Bias Break (Up): Indicates that the price has broken upwards out of the zone (with a green label).
Bias Break (Down): Indicates that the price has broken downwards out of the zone (with a red label).
These labels help traders easily identify potential breakout points.
Example Use Case
Bullish Market Conditions: If the RSI is above 50, the MACD histogram is positive, and OBV is increasing, the script will highlight a green bias zone. Traders can watch for potential bullish breakouts or trend continuation after the zone ends.
Bearish Market Conditions: If the RSI is below 50, the MACD histogram is negative, and OBV is decreasing, the script will highlight a red bias zone. Traders can look for potential bearish breakouts when the zone ends.
Conclusion
The Frozen Bias Zones indicator is a powerful tool for traders looking to visualize prolonged market sentiment, whether bullish or bearish. By combining RSI, MACD, and OBV, it helps traders spot when the market is "locked in" to a bias. The breakout labels make it easier to take action when the price moves outside of the established zone, potentially signaling the start of a new trend.
Instructions
To use this script:
Add the Frozen Bias Zones indicator to your TradingView chart.
Adjust the input parameters to suit your trading strategy.
Observe the colored bias zones on your chart, along with breakout labels, to make informed decisions on trend continuation or reversal.
Combined EMA/Smiley & DEM System## 🔷 General Overview
This script creates an advanced technical analysis system for TradingView, combining multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), dynamic Fibonacci levels, and ATR (Average True Range) analysis. It presents the results clearly through interactive, real-time tables directly on the chart.
---
## 🔹 Indicator Structure
The script consists of two main parts:
### **1. EMA & SMA Combined System with Fibonacci**
- **Purpose:**
Provides visual insights by comparing multiple EMA/SMA periods and identifying significant dynamic price levels using Fibonacci ratios around a calculated "Golden" line.
- **Components:**
- **Moving Averages (MAs)**:
- 20 EMAs (periods from 20 to 400)
- 20 SMAs (also from 20 to 400)
- **Golden Line:**
Calculated as the average of all EMAs and SMAs.
- **Dynamic Fibonacci Levels:**
Key ratios around the Golden line (0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.0) dynamically adjust based on market conditions.
- **Fibonacci Labels:**
Labels are shown next to Fibonacci lines, indicating their numeric value clearly on the chart.
- **Table (Top Right Corner):**
- Displays:
- **Input:** EMA/SMA periods sorted by their current average price levels.
- **AVG:** The average of corresponding EMA & SMA pairs.
- **EMA & SMA Values:** Individual EMA/SMA values clearly marked.
- **Dynamic Highlighting:** Highlights the row whose average (EMA+SMA)/2 is closest to the current price, helping identify immediate price action significance.
- **Sorting Logic:**
Each EMA/SMA pair is dynamically sorted based on their average values. Color coding (red/green) is used:
- **Green:** EMA/SMA pairs with shorter periods when their average is lower.
- **Red:** EMA/SMA pairs with longer periods when their average is lower.
- **Star (⭐):** Represents the "Golden" average clearly.
---
### **2. DEM System (Dynamic EMA/ATR Metrics)**
- **Purpose:**
Provides detailed ATR statistics to assess market volatility clearly and quickly.
- **Components:**
- **Moving Averages:**
- SMA lines: 25, 50, 100, 200.
- **Bollinger Bands:**
- Based on 20-period SMA of highs and standard deviation of lows.
- **ATR Analysis:**
- ATR calculations for multiple periods (1-day, 10, 20, 30, 40, 50).
- **ATR Premium:** Average ATR of all calculated periods, providing an overarching volatility indicator.
- **ATR Table (Bottom Right Corner):**
- Displays clearly structured ATR values and percentages relative to the current close price:
- Columns: **ATR Period**, **Value**, and **% of Close**.
- Rows: Each specific ATR (1D, 10, 20, 30, 40, 50), plus ATR premium.
- The ATR premium is highlighted in yellow to signify its importance clearly.
---
## 🔹 Key Features and Logic Explained
- **Dynamic EMA/SMA Sorting:**
The script computes the average of each EMA/SMA pair and sorts them dynamically on each bar, highlighting their relative importance visually. This allows traders to easily interpret the strength of current support/resistance levels based on moving averages.
- **Closest EMA/SMA Pair to Current Price:**
Calculates the absolute difference between the current price and all EMA/SMA averages, highlighting the closest one for quick reference.
- **Fibonacci Ratios:**
- Dynamically calculated Fibonacci levels based on the "Golden" EMA/SMA average give clear visual guidance for potential targets, supports, and resistances.
- Labels are continuously updated and placed next to levels for clarity.
- **ATR Volatility Analysis:**
- Provides immediate insight into market volatility with absolute and relative (percentage-based) ATR values.
- ATR premium summarizes volatility across multiple timeframes clearly.
---
## 🔹 Practical Use Case:
- Traders can quickly identify support/resistance and critical price zones through EMA/SMA and Fibonacci combinations.
- Useful in assessing immediate volatility, guiding stop-loss and take-profit levels through detailed ATR metrics.
- The dynamic highlighting in tables provides intuitive, real-time decision support for active traders.
---
## 🔹 How to Use this Script:
1. **Adjust EMA & SMA Lengths** from indicator settings if different periods are preferred.
2. **Monitor dynamic Fibonacci levels** around the "Golden" average to identify possible reversal or continuation points.
3. **Check EMA/SMA table:** Rows highlighted indicate immediate significance concerning current market price.
4. **ATR table:** Use volatility metrics for better risk management.
---
## 🔷 Conclusion
This advanced Pine Script indicator efficiently combines multiple EMAs, SMAs, dynamic Fibonacci retracement levels, and volatility analysis using ATR into a comprehensive real-time analytical tool, enhancing traders' decision-making capabilities by providing clear and actionable insights directly on the TradingView chart.
Correlation Heatmap█ OVERVIEW
This indicator creates a correlation matrix for a user-specified list of symbols based on their time-aligned weekly or monthly price returns. It calculates the Pearson correlation coefficient for each possible symbol pair, and it displays the results in a symmetric table with heatmap-colored cells. This format provides an intuitive view of the linear relationships between various symbols' price movements over a specific time range.
█ CONCEPTS
Correlation
Correlation typically refers to an observable statistical relationship between two datasets. In a financial time series context, it usually represents the extent to which sampled values from a pair of datasets, such as two series of price returns, vary jointly over time. More specifically, in this context, correlation describes the strength and direction of the relationship between the samples from both series.
If two separate time series tend to rise and fall together proportionally, they might be highly correlated. Likewise, if the series often vary in opposite directions, they might have a strong anticorrelation . If the two series do not exhibit a clear relationship, they might be uncorrelated .
Traders frequently analyze asset correlations to help optimize portfolios, assess market behaviors, identify potential risks, and support trading decisions. For instance, correlation often plays a key role in diversification . When two instruments exhibit a strong correlation in their returns, it might indicate that buying or selling both carries elevated unsystematic risk . Therefore, traders often aim to create balanced portfolios of relatively uncorrelated or anticorrelated assets to help promote investment diversity and potentially offset some of the risks.
When using correlation analysis to support investment decisions, it is crucial to understand the following caveats:
• Correlation does not imply causation . Two assets might vary jointly over an analyzed range, resulting in high correlation or anticorrelation in their returns, but that does not indicate that either instrument directly influences the other. Joint variability between assets might occur because of shared sensitivities to external factors, such as interest rates or global sentiment, or it might be entirely coincidental. In other words, correlation does not provide sufficient information to identify cause-and-effect relationships.
• Correlation does not predict the future relationship between two assets. It only reflects the estimated strength and direction of the relationship between the current analyzed samples. Financial time series are ever-changing. A strong trend between two assets can weaken or reverse in the future.
Correlation coefficient
A correlation coefficient is a numeric measure of correlation. Several coefficients exist, each quantifying different types of relationships between two datasets. The most common and widely known measure is the Pearson product-moment correlation coefficient , also known as the Pearson correlation coefficient or Pearson's r . Usually, when the term "correlation coefficient" is used without context, it refers to this correlation measure.
The Pearson correlation coefficient quantifies the strength and direction of the linear relationship between two variables. In other words, it indicates how consistently variables' values move together or in opposite directions in a proportional, linear manner. Its formula is as follows:
𝑟(𝑥, 𝑦) = cov(𝑥, 𝑦) / (𝜎𝑥 * 𝜎𝑦)
Where:
• 𝑥 is the first variable, and 𝑦 is the second variable.
• cov(𝑥, 𝑦) is the covariance between 𝑥 and 𝑦.
• 𝜎𝑥 is the standard deviation of 𝑥.
• 𝜎𝑦 is the standard deviation of 𝑦.
In essence, the correlation coefficient measures the covariance between two variables, normalized by the product of their standard deviations. The coefficient's value ranges from -1 to 1, allowing a more straightforward interpretation of the relationship between two datasets than what covariance alone provides:
• A value of 1 indicates a perfect positive correlation over the analyzed sample. As one variable's value changes, the other variable's value changes proportionally in the same direction .
• A value of -1 indicates a perfect negative correlation (anticorrelation). As one variable's value increases, the other variable's value decreases proportionally.
• A value of 0 indicates no linear relationship between the variables over the analyzed sample.
Aligning returns across instruments
In a financial time series, each data point (i.e., bar) in a sample represents information collected in periodic intervals. For instance, on a "1D" chart, bars form at specific times as successive days elapse.
However, the times of the data points for a symbol's standard dataset depend on its active sessions , and sessions vary across instrument types. For example, the daily session for NYSE stocks is 09:30 - 16:00 UTC-4/-5 on weekdays, Forex instruments have 24-hour sessions that span from 17:00 UTC-4/-5 on one weekday to 17:00 on the next, and new daily sessions for cryptocurrencies start at 00:00 UTC every day because crypto markets are consistently open.
Therefore, comparing the standard datasets for different asset types to identify correlations presents a challenge. If two symbols' datasets have bars that form at unaligned times, their correlation coefficient does not accurately describe their relationship. When calculating correlations between the returns for two assets, both datasets must maintain consistent time alignment in their values and cover identical ranges for meaningful results.
To address the issue of time alignment across instruments, this indicator requests confirmed weekly or monthly data from spread tickers constructed from the chart's ticker and another specified ticker. The datasets for spreads are derived from lower-timeframe data to ensure the values from all symbols come from aligned points in time, allowing a fair comparison between different instrument types. Additionally, each spread ticker ID includes necessary modifiers, such as extended hours and adjustments.
In this indicator, we use the following process to retrieve time-aligned returns for correlation calculations:
1. Request the current and previous prices from a spread representing the sum of the chart symbol and another symbol ( "chartSymbol + anotherSymbol" ).
2. Request the prices from another spread representing the difference between the two symbols ( "chartSymbol - anotherSymbol" ).
3. Calculate half of the difference between the values from both spreads ( 0.5 * (requestedSum - requestedDifference) ). The results represent the symbol's prices at times aligned with the sample points on the current chart.
4. Calculate the arithmetic return of the retrieved prices: (currentPrice - previousPrice) / previousPrice
5. Repeat steps 1-4 for each symbol requiring analysis.
It's crucial to note that because this process retrieves prices for a symbol at times consistent with periodic points on the current chart, the values can represent prices from before or after the closing time of the symbol's usual session.
Additionally, note that the maximum number of weeks or months in the correlation calculations depends on the chart's range and the largest time range common to all the requested symbols. To maximize the amount of data available for the calculations, we recommend setting the chart to use a daily or higher timeframe and specifying a chart symbol that covers a sufficient time range for your needs.
█ FEATURES
This indicator analyzes the correlations between several pairs of user-specified symbols to provide a structured, intuitive view of the relationships in their returns. Below are the indicator's key features:
Requesting a list of securities
The "Symbol list" text box in the indicator's "Settings/Inputs" tab accepts a comma-separated list of symbols or ticker identifiers with optional spaces (e.g., "XOM, MSFT, BITSTAMP:BTCUSD"). The indicator dynamically requests returns for each symbol in the list, then calculates the correlation between each pair of return series for its heatmap display.
Each item in the list must represent a valid symbol or ticker ID. If the list includes an invalid symbol, the script raises a runtime error.
To specify a broker/exchange for a symbol, include its name as a prefix with a colon in the "EXCHANGE:SYMBOL" format. If a symbol in the list does not specify an exchange prefix, the indicator selects the most commonly used exchange when requesting the data.
Note that the number of symbols allowed in the list depends on the user's plan. Users with non-professional plans can compare up to 20 symbols with this indicator, and users with professional plans can compare up to 32 symbols.
Timeframe and data length selection
The "Returns timeframe" input specifies whether the indicator uses weekly or monthly returns in its calculations. By default, its value is "1M", meaning the indicator analyzes monthly returns. Note that this script requires a chart timeframe lower than or equal to "1M". If the chart uses a higher timeframe, it causes a runtime error.
To customize the length of the data used in the correlation calculations, use the "Max periods" input. When enabled, the indicator limits the calculation window to the number of periods specified in the input field. Otherwise, it uses the chart's time range as the limit. The top-left corner of the table shows the number of confirmed weeks or months used in the calculations.
It's important to note that the number of confirmed periods in the correlation calculations is limited to the largest time range common to all the requested datasets, because a meaningful correlation matrix requires analyzing each symbol's returns under the same market conditions. Therefore, the correlation matrix can show different results for the same symbol pair if another listed symbol restricts the aligned data to a shorter time range.
Heatmap display
This indicator displays the correlations for each symbol pair in a heatmap-styled table representing a symmetric correlation matrix. Each row and column corresponds to a specific symbol, and the cells at their intersections correspond to symbol pairs . For example, the cell at the "AAPL" row and "MSFT" column shows the weekly or monthly correlation between those two symbols' returns. Likewise, the cell at the "MSFT" row and "AAPL" column shows the same value.
Note that the main diagonal cells in the display, where the row and column refer to the same symbol, all show a value of 1 because any series of non-na data is always perfectly correlated with itself.
The background of each correlation cell uses a gradient color based on the correlation value. By default, the gradient uses blue hues for positive correlation, orange hues for negative correlation, and white for no correlation. The intensity of each blue or orange hue corresponds to the strength of the measured correlation or anticorrelation. Users can customize the gradient's base colors using the inputs in the "Color gradient" section of the "Settings/Inputs" tab.
█ FOR Pine Script® CODERS
• This script uses the `getArrayFromString()` function from our ValueAtTime library to process the input list of symbols. The function splits the "string" value by its commas, then constructs an array of non-empty strings without leading or trailing whitespaces. Additionally, it uses the str.upper() function to convert each symbol's characters to uppercase.
• The script's `getAlignedReturns()` function requests time-aligned prices with two request.security() calls that use spread tickers based on the chart's symbol and another symbol. Then, it calculates the arithmetic return using the `changePercent()` function from the ta library. The `collectReturns()` function uses `getAlignedReturns()` within a loop and stores the data from each call within a matrix . The script calls the `arrayCorrelation()` function on pairs of rows from the returned matrix to calculate the correlation values.
• For consistency, the `getAlignedReturns()` function includes extended hours and dividend adjustment modifiers in its data requests. Additionally, it includes other settings inherited from the chart's context, such as "settlement-as-close" preferences.
• A Pine script can execute up to 40 or 64 unique `request.*()` function calls, depending on the user's plan. The maximum number of symbols this script compares is half the plan's limit, because `getAlignedReturns()` uses two request.security() calls.
• This script can use the request.security() function within a loop because all scripts in Pine v6 enable dynamic requests by default. Refer to the Dynamic requests section of the Other timeframes and data page to learn more about this feature, and see our v6 migration guide to learn what's new in Pine v6.
• The script's table uses two distinct color.from_gradient() calls in a switch structure to determine the cell colors for positive and negative correlation values. One call calculates the color for values from -1 to 0 based on the first and second input colors, and the other calculates the colors for values from 0 to 1 based on the second and third input colors.
Look first. Then leap.
Change % Inteligente - NQ / ES / YMTopstep Compliance: Daily Price Change % Alert (NQ / ES / YM)
Script Purpose
This script helps funded traders (especially those using Topstep or similar programs) monitor the real-time percentage change of major equity index futures: Nasdaq (NQ), S&P 500 (ES), and Dow Jones (YM).
⚠️ Why it matters
Topstep prohibits trading within 2% of the daily price limits set by the CME. If a trader holds a position too close to those limits, they risk account disqualification.
📊 How it works
• Detects the instrument: NQ1!, ES1!, YM1!, or M2025 contracts
• Calculates the real-time % change from today’s market open
• Simulates daily CME price limits (+7% / -7%)
• Highlights when price enters the last 2% of the limit range (prohibited zone)
• Displays a clean, floating panel with the current % change and a warning if necessary
• Sends a visual and optional audio alert when in the prohibited zone
🧠 What makes this script unique?
This tool is **not for technical analysis**. It focuses exclusively on **funding program compliance** and **account protection**, which is not covered by other public scripts. It’s lightweight, intuitive, and designed for traders who manage risk like professionals.
✅ Open-source and ready for review.
✅ CHART SETUP FOR PUBLICATION
✔️ Use a clean chart
✔️ Only apply this script
✔️ Make sure the panel is visible (top-right or top-center recommended)
❌ No extra indicators or drawings
✔️ Use NQM2025, ESM2025 or YMM2025 on a volatile day (to show -1% to -3% range)
INSTRUCTIONS
1. Add the script to your chart.
2. Use it with NQ1!, ES1!, or YM1! (or M2025 contracts).
3. The panel will show today’s price change %.
4. If the market is within the last 2% of the CME price limit, a warning will appear.
5. Use this to avoid violating Topstep’s trading rules during volatile days.
Moving Average Convergence DivergenceThis script is written in Pine Script (version 6) for TradingView and implements the **Moving Average Convergence Divergence (MACD)** indicator. The MACD is a popular momentum oscillator used to identify trend direction, strength, and potential reversals. This version includes customizable inputs, visual enhancements (like crossover markers), and alerts for key events. Below is a detailed explanation of the script:
---
### **1. Purpose**
- The script calculates and displays the MACD line, signal line, and histogram.
- It highlights key events such as MACD/signal line crossovers and zero-line crosses with shapes and colors.
- It provides alerts for changes in the histogram's direction (rising to falling or vice versa).
---
### **2. User Inputs**
- **Fast Length**: Period for the fast moving average (default: 12).
- **Slow Length**: Period for the slow moving average (default: 26).
- **Source**: Data input for calculation (default: closing price, `close`).
- **Signal Smoothing**: Period for the signal line (default: 9, range: 1–50).
- **Oscillator MA Type**: Type of moving average for MACD calculation (options: SMA or EMA, default: EMA).
- **Signal Line MA Type**: Type of moving average for the signal line (options: SMA or EMA, default: EMA).
---
### **3. MACD Calculation**
The MACD is calculated in three parts:
1. **MACD Line**: Difference between the fast and slow moving averages.
- Fast MA: Either SMA or EMA of the source over `fast_length`.
- Slow MA: Either SMA or EMA of the source over `slow_length`.
- Formula: `macd = fast_ma - slow_ma`.
2. **Signal Line**: A moving average (SMA or EMA) of the MACD line over `signal_length`.
- Formula: `signal = sma_signal == "SMA" ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)`.
3. **Histogram**: Difference between the MACD line and the signal line.
- Formula: `hist = macd - signal`.
---
### **4. Key Events Detection**
#### **MACD/Signal Line Crossovers**
- **Bullish Cross**: MACD crosses above the signal line (`ta.crossover(macd, signal)`).
- **Bearish Cross**: MACD crosses below the signal line (`ta.crossunder(macd, signal)`).
#### **Zero Line Crosses**
- **Cross Above Zero**: MACD crosses above 0 (`ta.crossover(macd, 0)`).
- **Cross Below Zero**: MACD crosses below 0 (`ta.crossunder(macd, 0)`).
---
### **5. Colors**
- **MACD Line**: Green (#089981) if MACD > signal (bullish), red (#f23645) if MACD < signal (bearish).
- **Signal Line**: White (`color.white`).
- **Histogram**:
- Positive (MACD > signal): Light green (#B2DFDB) if decreasing, darker green (#26A69A) if increasing.
- Negative (MACD < signal): Light red (#FFCDD2) if increasing in magnitude, darker red (#FF5252) if decreasing in magnitude.
- **Zero Line**: Gray with 50% transparency (`color.new(#787B86, 50)`).
---
### **6. Visual Outputs**
#### **Plotted Lines**
- **MACD Line**: Plotted with dynamic coloring based on its position relative to the signal line.
- **Signal Line**: Plotted in white.
- **Histogram**: Displayed as columns, with colors indicating direction and momentum.
- **Zero Line**: Horizontal line at 0 for reference.
#### **Shapes for Key Events**
- **Bullish Cross Below Zero**: Green circle on the MACD line when MACD crosses above the signal line while still below zero.
- **Bearish Cross Above Zero**: Red circle on the MACD line when MACD crosses below the signal line while still above zero.
- **Cross Above Zero**: Green upward label at the zero line when MACD crosses above 0.
- **Cross Below Zero**: Red downward label at the zero line when MACD crosses below 0.
---
### **7. Alerts**
- **Rising to Falling**: Triggers when the histogram switches from positive (or zero) to negative.
- Condition: `hist >= 0 and hist < 0`.
- Message: "MACD histogram switched from rising to falling".
- **Falling to Rising**: Triggers when the histogram switches from negative (or zero) to positive.
- Condition: `hist <= 0 and hist > 0`.
- Message: "MACD histogram switched from falling to rising".
---
### **8. How It Works**
1. **Trend Direction**:
- MACD above signal line (green) suggests bullish momentum.
- MACD below signal line (red) suggests bearish momentum.
2. **Momentum Strength**:
- Histogram height shows the strength of the momentum (larger bars = stronger momentum).
- Histogram color changes indicate whether momentum is increasing or decreasing.
3. **Reversal Signals**:
- Crossovers between MACD and signal lines often signal potential trend changes.
- Zero-line crosses indicate shifts between bullish (above 0) and bearish (below 0) territory.
---
### **9. How to Use**
1. Add the script to TradingView.
2. Adjust inputs (e.g., fast/slow lengths, MA types) to suit your trading style.
3. Monitor the chart:
- Green MACD and upward histogram bars suggest bullish conditions.
- Red MACD and downward histogram bars suggest bearish conditions.
- Watch for circles (crossovers) and labels (zero-line crosses) for trade signals.
4. Set up alerts to notify you of histogram direction changes.
---
### **10. Key Features**
- **Customization**: Flexible MA types and periods.
- **Visual Clarity**: Dynamic colors and shapes highlight key events.
- **Alerts**: Notifies users of momentum shifts via histogram changes.
- **Intuitive**: Combines all MACD components (line, signal, histogram) in one indicator.
This script is ideal for traders who rely on MACD for momentum analysis and want clear visual cues and alerts for decision-making.
TimeMapTimeMap is a visual price-reference indicator designed to help traders rapidly visualize how current price levels relate to significant historical closing prices. It overlays your chart with reference lines representing past weekly, monthly, quarterly (3-month), semi-annual (6-month), and annual closing prices. By clearly plotting these historical price references, TimeMap helps traders quickly gauge price position relative to historical market structure, aiding in the identification of trends, support/resistance levels, and potential reversals.
How it Works:
The indicator calculates the precise number of historical bars corresponding to weekly, monthly, quarterly, semi-annual, and annual intervals, dynamically adjusting according to your chart’s timeframe (intraday, daily, weekly, monthly) and chosen market type (Stocks US, Crypto, Forex, or Futures). Historical closing prices from these periods are plotted directly on your chart as horizontal reference lines.
For intraday traders, the script accurately calculates historical offsets considering regular and extended trading sessions (e.g., pre-market and after-hours sessions for US stocks), ensuring correct positioning of historical lines.
User-Configurable Inputs Explained in Detail:
Market Type:
Allows you to specify your trading instrument type, automatically adjusting calculations for:
- Stocks US (default): 390 minutes per regular session (780 minutes if extended hours enabled), 5 trading days/week.
- Crypto: 1440 minutes/day, 7 trading days/week.
- Forex: 1440 minutes/day, 5 trading days/week.
- Futures: 1320 minutes/day, 5 trading days/week.
Show Weekly Close:
When enabled, plots a line at the exact closing price from one week ago. Provides short-term context and helps identify recent price momentum.
Show Monthly Close:
When enabled, plots a line at the exact closing price from one month ago. Helpful for evaluating medium-term price positioning and monthly trend strength.
Show 3-Month Close:
When enabled, plots a line at the exact closing price from three months ago. Useful for assessing quarterly market shifts, intermediate trend changes, and broader market sentiment.
Show 6-Month Close:
When enabled, plots a line at the exact closing price from six months ago. Useful for identifying semi-annual trends, significant price pivots, and longer-term support/resistance levels.
Show 1-Year Close:
When enabled, plots a line at the exact closing price from one year ago. Excellent for assessing long-term market direction and key annual price levels.
Enable Smoothing:
Activates a Simple Moving Average (SMA) smoothing of historical reference lines, reducing volatility and providing clearer visual references. Recommended for traders preferring less volatile reference levels.
Smoothing Length:
Determines the number of bars used in calculating the SMA smoothing of historical lines. Higher values result in smoother but slightly delayed reference lines; lower values offer more immediate yet more volatile levels.
Use Extended Hours (Intraday Only):
When enabled (only applicable for Stocks US), it accounts for pre-market and after-hours trading sessions, providing accurate intraday historical line calculations based on extended sessions (typically 780 minutes/day total).
Important Notes and Compliance:
- This indicator does not provide trading signals, recommendations, or predictions. It serves purely as a visual analytical tool to supplement traders’ existing methods.
- Historical lines plotted are strictly based on past available price data; the indicator never accesses future data or data outside the scope of Pine Script’s standard capabilities.
- The script incorporates built-in logic to avoid runtime errors if insufficient historical data exists for a selected timeframe, ensuring robustness even with limited historical bars.
- TimeMap is original work developed exclusively by Julien Eche (@Julien_Eche). It does not reuse or replicate third-party or existing open-source scripts.
Recommended Best Practices:
- Use TimeMap as a complementary analytical reference, not as a standalone strategy or trade decision-making tool.
- Adapt displayed historical periods and smoothing settings based on your trading style and market approach.
- Default plot colors are optimized for readability on dark-background charts; adjust as necessary according to your preference and chart color scheme.
This script is published open-source to benefit the entire TradingView community and fully complies with all TradingView script publishing rules and guidelines.
Wave N + KDJ + Volumi + SMC + IchimokuWave N + KDJ + Volume + SMC + Ichimoku Indicator
Overview
This script is a multi-layered technical indicator designed to provide traders with enhanced market insights by combining five key methodologies:
• Wave N Pattern (Price Action)
• KDJ Oscillator (Momentum)
• Volume Filtering (Confirmation)
• Smart Money Concepts (Order Blocks) (Institutional Activity)
• Ichimoku Cloud (Trend and Support/Resistance)
By integrating these components, the indicator identifies high-probability trading signals, early warnings of trend shifts, and institutional price zones to improve decision-making in volatile markets.
⸻
How It Works
1️⃣ Wave N Pattern (Price Action Structure)
The Wave N pattern is a classic price action formation that helps spot potential trend reversals and continuations:
• A Bullish Wave N is detected when a higher low and a higher high structure appears.
• A Bearish Wave N is detected when a lower high and a lower low structure forms.
2️⃣ KDJ Oscillator (Momentum & Trend Strength)
The KDJ Indicator is a variation of the Stochastic Oscillator that adds a third line, J, to amplify sensitivity to trend movements.
• J > 50 indicates bullish momentum.
• J < 50 indicates bearish momentum.
• The script includes an early warning signal when J crosses 50, suggesting a possible trend shift.
3️⃣ Volume Filtering (Trade Confirmation)
To avoid false signals, the script integrates volume confirmation:
• A signal is valid only if the volume is above the 20-period EMA of volume.
• This ensures that trade signals are supported by strong market participation.
4️⃣ Smart Money Concepts (Order Blocks)
Order Blocks represent areas of institutional interest, where large traders accumulate or distribute positions.
• The script detects bullish order blocks (potential support) and bearish order blocks (potential resistance).
• These areas help identify optimal entry and exit points.
5️⃣ Ichimoku Cloud (Trend & Dynamic Support/Resistance)
The Ichimoku Cloud is used to confirm trend direction:
• Baseline (Kijun-sen) acts as a key trend filter.
• Senkou Span A & B form the cloud (Kumo), indicating dynamic support/resistance.
• Buy signals require price to be above the baseline, while sell signals require price to be below the baseline.
⸻
Trading Signals & Visual Elements
✅ BUY Signal (Green Arrow)
Occurs when:
• A Bullish Wave N forms
• J > 50 (Bullish KDJ Signal)
• Volume is above EMA threshold
• Price is above the Ichimoku Baseline
❌ SELL Signal (Red Arrow)
Occurs when:
• A Bearish Wave N forms
• J < 50 (Bearish KDJ Signal)
• Volume is above EMA threshold
• Price is below the Ichimoku Baseline
⚠️ Early Warning (Trend Shift Signal)
• An early warning appears when J crosses 50, indicating a possible upcoming trend shift.
• The line color changes based on the potential move:
• Green/Blue → Possible Uptrend
• Red/Orange → Possible Downtrend
⸻
Why This Indicator is Unique?
Unlike simple trend-following indicators, this script:
• Combines Price Action, Momentum, Volume, and Institutional Order Flow for a multi-dimensional approach.
• Filters out weak signals using volume confirmation and Ichimoku.
• Provides early warnings before major trend shifts.
• Visualizes Smart Money Order Blocks, giving traders an edge in spotting institutional zones.
⸻
Best Timeframes & Markets
📊 Recommended Timeframes:
• 1H & 1D (works best on medium/long-term trends)
💹 Markets:
• Crypto, Forex, and Stocks
This indicator is designed for traders who value confluence and strong confirmation in their strategies. Whether you are a trend trader, swing trader, or institutional flow analyst, this tool can help refine your decision-making process.
🚀 Optimize your trades with Wave N + KDJ + Volume + SMC + Ichimoku! 🚀
EMA Alignment & Spread Monitor (Sang Youn)Overview
The EMA Alignment & Spread Monitor is a dynamic trading script designed to monitor EMA (Exponential Moving Average) alignments, track spread deviations, and provide real-time alerts when significant conditions are met. This script allows traders to customize their EMA periods, analyze market trends based on EMA positioning, and receive visual and audio alerts when key spread conditions occur.
🔹 Key Features
✅ Customizable EMA Periods – Users can input their own EMA lengths to adapt the script to various market conditions. (Default: 5, 10, 20, 60, 120)
✅ EMA Alignment Detection – Identifies bullish alignment (all EMAs in ascending order) and bearish alignment (all EMAs in descending order).
✅ Spread Calculation & Monitoring – Computes the spread difference between each EMA and tracks the average spread over a user-defined period.
✅ Deviation Alerts – Notifies traders when:
Bullish Trend: The spread exceeds its average, indicating a potential strong uptrend.
Bearish Trend: The spread falls below its average, signaling a possible downtrend.
✅ Chart Annotations – Displays 📈 (green triangle) when bullish spread exceeds average and 📉 (red triangle) when bearish spread drops below average for easy visualization.
✅ Real-time Alerts – Sends alerts when spread conditions are met, helping traders react to market shifts efficiently.
✅ Spread Histogram – Visual representation of bullish and bearish spread levels for trend analysis.
🔹 How It Works
1️⃣ Set your EMA periods in the script settings (default: 5, 10, 20, 60, 120).
2️⃣ Define the spread average calculation length (default: 50 candles).
3️⃣ The script tracks EMA alignment to determine bullish or bearish trends.
4️⃣ If the spread deviates significantly from its average, the script:
Places a 📈 green triangle above candles in a bullish trend when spread > average.
Places a 📉 red triangle below candles in a bearish trend when spread < average.
Triggers an alert for timely decision-making.
5️⃣ Use the histogram & real-time alerts to stay ahead of market movements.
Time-based Alerts for Trading Windows🌟 Time-based Alerts for Trading Windows 🌐📈
This is a re-uploaded script as the previous one got hidden.
This Time-based Alerts for Trading Windows script is a highly customizable and reliable tool designed to assist traders in managing automated strategies or manually monitoring specific market conditions. Inspired by CrossTrade's Time-based Alert, this script is tailored for those who rely on precise time windows to trigger actions, such as sending webhook signals or managing Expert Advisors (EAs).
Whether you are a scalper, day trader, or algorithmic trader, this script empowers you to stay on top of your trades with fully customizable time-based alerts.
🛠️ Customizable Time Alerts
This indicator allows you to create up to 12 unique time windows by specifying the exact hour and minute for each alert. Each time window corresponds to an individual alert condition, making it perfect for managing trades during specific market sessions or key time periods.
For example:
Alert 1 can be set at 9:30 AM (market open).
Alert 2 can be set at 3:55 PM (just before market close).
Each alert can be toggled on or off in the indicator settings, allowing you to manage alerts without having to reconfigure your script.
You can adjust the colours to fit any colour scheme you like!
🕒 Odd and Even Time Alerts
The script comes with three built-in alert type categories:
Odd Alerts (marked with a green triangle on the chart): These correspond to odd-numbered inputs like Alert 1, Alert 3, Alert 5, and so on.
Even Alerts (marked with a red triangle on the chart): These correspond to even-numbered inputs like Alert 2, Alert 4, Alert 6, and so on.
You can also customize all 12 alerts individually to include a custom alert message
These alerts serve as a convenient way to differentiate between multiple trading strategies or market conditions. You can customize alert messages for odd and even alerts directly from TradingView’s alert panel.
🔗 Webhook Integration for Automation
This script is fully compatible with webhook-based automation. By configuring your alerts in TradingView, you can send signals to trading bots, EAs, or any third-party system. For example, you can:
Turn off an EA at a specific time (e.g., 3:55 PM EST).
Send buy/sell signals to your bot during predefined trading windows.
Simply use TradingView’s alert message editor to format webhook payloads for your automation system.
🌐 Timezone Flexibility
Trading happens across multiple time zones, and this script accounts for that. You can toggle between:
Eastern Time (New York): Ideal for most US-based markets.
Central Time (Exchange): Useful for futures and commodities traders.
This ensures your alerts are always in sync with your preferred time zone, eliminating confusion.
🎨 Visual Indicators
The script plots visual markers directly on your chart to indicate active alerts:
Up Facing Triangles: Represent odd-numbered alerts, providing a quick reference for these time windows.
Down Facing Triangles: Represent even-numbered alerts, helping you track different strategies or conditions.
These visual markers make it easy to see when alerts are triggered, even at a glance.
📈 Practical Use Case
Let’s say you’re trading the USTEC index on a 1-minute chart. You want to:
Turn off your trading bot at 16:55 EST to avoid after-market volatility.
Trigger a re-entry signal at 17:30 EST to capture moves during the Asian session.
Visually monitor these actions on your chart for easy reference.
This script makes it possible with precision alerts and webhook integration. Simply configure the time windows in the settings and set up your alerts in TradingView.
🚨 How to Set Up Alerts
Enable or Disable Alerts: Use the script’s settings to toggle specific alerts on or off as needed.
Set Custom Time Windows: Define the hour and minute for each alert in the settings panel.
Create Alerts in TradingView:
Go to the TradingView alert panel.
Select the condition (e.g., "Odd Time-based Alert (Green)" or "Even Time-based Alert (Red)").
Customize the alert message for webhook integration or personal notification.
Choose the trigger type: Once Per Bar or Once Per Bar Close to keep the alert active.
Integrate with Webhooks: Use the alert message field to format payloads for automation systems like MT4, MT5, or third-party bots.
📋 Key Notes
Alerts can trigger indefinitely if set to "Once Per Bar" or "Once Per Bar Close".
Always ensure the expiration date is set far in the future to avoid unexpected alert deactivation.
Test webhook messages and alert configurations thoroughly before using them in live trading.
This script is a powerful addition to your trading toolbox, offering precision, flexibility, and automation capabilities. Whether you’re turning off an EA, managing trades during market sessions, or automating strategies via webhooks, this script is here to support you.
Start using the Time-based Alerts for Trading Windows today and trade with confidence! 🚀✨